<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
cookie讲解
<script src="../js/js.cookie.min.js"></script>
<script>
    console.log(location.href);//encodeURIComponent()转义过
    console.log(decodeURIComponent(location.href));
    let time = Date.now() + 30 * 1000;
    console.log(time);
    Cookies.set("name", "haha");//没有设置过期时间，则浏览器关闭时，删除该cookie
    Cookies.set("age", 18, {
        //默认单位是天，如果设置其它时间，通过Date处理
        // expires: 1.txt
        // expires: 1.txt / 24 / 60 / 60 * 30
        // expires: new Date(time),
    });
    console.log(Cookies.get("name"));
    let cookieInfo = Cookies.get();//获取所有cookie信息
    console.log(cookieInfo.name);
    console.log(Cookies.remove("age"));//失败
    // console.log(Cookies.set("age", null));
    setTimeout(function () {
        console.log(Cookies.get("age"))
    }, 1000);
</script>
</body>
</html>